﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;

namespace MyTest
{
    public partial class Form3 : Form
    {
        public Form3()
        {
            InitializeComponent();
        }

        LoadFrm loader = null;
        private void button1_Click(object sender, EventArgs e)
        {

            loader=new LoadFrm();
            SendOrPostCallback custommethod = delegate(object obj)
            {
                Console.Write(obj.ToString());
                Thread.Sleep(1000);
                loader.SetValueMethod(30, obj.ToString());
                DateTime now = DateTime.Now;
                Thread.Sleep(1000);
                loader.SetValueMethod(60, now.ToString());
                now = DateTime.Now;
                Thread.Sleep(1000);
                loader.SetValueMethod(100, now.ToString());
                loader.Close();
            };
            loader.RegisterMesthod(custommethod, DateTime.Now);
            loader.ShowDialog();

        }
    }
}
